<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS Map</title>
</head>
<body>
<p>keys() 方法返回一个迭代器对象，其中包含 Map 中的键</p>
<p id="demo"></p>

<script>
  const fruits = new Map([
          ["apples",500],
          ["bananas",300],
          ["oranges",200]
  ]);

  let text = "";
  //map.values返回值
  for (const x of fruits.keys()){
    text += x + "<br/>";
  }

  document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>